/*
 * @Author: 大D
 * @email: 857216393@qq.com
 * @Date: 2023-12-21 12:47:39
 * @Description:音乐 接口
 */
import http from '@/apis/request/http';
import type { Res, IMusic } from './type';
/** 获取榜单 */
export const getMusicToplist = () => {
  return http<Res>({
    url: '/musicapi/toplist/detail',
    interceptors: {
      request(config) {
        return config;
      },
      response(res) {
        return res;
      }
    }
  });
};

/** 获取榜单歌曲列表 */
export const getTopDetaliList = ({ id, limit, offset }: IMusic) => {
  return http<Res>({
    url: '/musicapi/playlist/track/all',
    data: {
      id,
      limit,
      offset
    }
  });
};

/** 获取歌曲详情 主要是播放地址 */
export const getMusicDetail = ({ id, level = 'lossless' }: IMusic) => {
  return http<Res>({
    url: '/musicapi/song/url/v1',
    data: {
      id,
      level
    }
  });
};
